import { RouteMapManager, type RequestMap } from 'my-ts-core/security';

/**
 * IMPORTANT!!!
 * Always keep it in mind that permission / authentication / authorization MUST be applied on server side first.
 * Any client side check is for user experience ONLY.
 * NEVER TRUST CLIENT!
 */
export default class RouteMapConfig {
  static getRequestMaps(): RequestMap[] {
    return [
      {
        url: '/authentication/login',
        configAttribute: RouteMapManager.permitAll,
      },
      {
        url: '/stomp-demo',
        configAttribute: RouteMapManager.permitAll,
      },
      {
        url: '/home',
        configAttribute: RouteMapManager.isAuthenticated,
      },
      {
        url: '/users/**',
        configAttribute: RouteMapManager.isAuthenticated,
      },
    ];
  }
}
